import App from './App'
import uView from 'uview-ui'
import store from './store'
import bootstrap from './core/bootstrap' // 获取本地储存信息 token userID
// 导入全局组件
// import './components'

import {
	navTo,
	showToast,
	showSuccess,
	showError,
	getShareUrlParams
} from './utils/app.js'

// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
Vue.use(uView)

// 挂载全局函数
Vue.prototype.$toast = showToast
Vue.prototype.$success = showSuccess
Vue.prototype.$error = showError
Vue.prototype.$navTo = navTo
Vue.prototype.$getShareUrlParams = getShareUrlParams

const app = new Vue({
  ...App,
  created: bootstrap,
  store
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif